<div class="ibox-title">
  <h5>座位安排</h5>
</div>

<div class="ibox-content">
  <div class="table-responsive">
    <div>
      <%= link_to new_event_seat_path(reload_seat: true, session_id: @session.id) do %>
        <i class="fa fa-refresh"></i>
        <span class="nav-label">重新安排</span>
      <% end %>
    </div>

    <br>
    <br>
    <center style="background-color: #999; color: #fff">主席台</center>
    <br>
    <br>

    <table class="table table-hover" style="width: 100%">
      <% for i in 1..@session.session_seat.total_table_count %>
      <tr>
        <% for j in 1..@session.session_seat.per_table_num %>
        <% seat = @session.seats.seat_position_is(i, j).first %>
        <td>
          <% if seat.present? %>
            <button type="button" class="seat" data-seat-id="<%= seat.id %>"><%= seat.attendee.name %></button>
          <% else %>
            <button type="button">&nbsp&nbsp&nbsp&nbsp</button>
          <% end %>
        </td>
        <% end %>
      </tr>
      <% end %>
    </table>
  </div>
</div>
